home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earcd / grafica / video easel / camrexx / randanneal.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-30  |  662b  |  26 lines

  1. /* Rand-Anneal by an idea of Toffoli, CAMRexx version by THOR */
  2.  
  3. MakeAlgorithm:
  4.    PLANEALGORITHM neumann hv
  5. return
  6.  
  7. MakePlane:
  8.    if plane=0 then; do
  9.    /* anneal-algorithm */
  10.       sum=center+north+south+west+east
  11.       rand=center_ & north_ & south_ & west_ & east_
  12.       if sum<parameters.border-1 then SETPLANE off
  13.       if sum=parameters.border-1 then SETPLANE rand
  14.       if sum=parameters.border then; do
  15.          rand=~rand
  16.          SETPLANE rand
  17.       end
  18.       if sum>parameters.border then SETPLANE on
  19.    end
  20.    /* "random" generator */
  21.    if plane=1 then; do
  22.       rand=(east_ & south_ ) ^ west_ ^ north_ ^ center_
  23.       SETPLANE rand
  24.    end
  25. return
  26.